let obj = {
    foo: 'hello'
}

let protoObj = {}

Object.setPrototypeOf(obj, protoObj)

protoObj.bar = 'world'
protoObj[12] = 45

console.log(obj[12])
console.log(obj.bar)
console.log(Object.keys(obj))

// --------------

let r = Object.getPrototypeOf(obj)
console.log(r)

function Rectangle() {}
let rect = new Rectangle()
console.log(Object.getPrototypeOf(rect) === Rectangle.prototype)